//
//  WmcPresentStyle.swift
//  YPWatermarkCamera
//
//  Created by 赵新 on 2022/3/3.
//

import UIKit
import YPBedrock

// MARK: - 样式扩展带参枚举

public extension WmcPresentVC {
    /// 样式
    enum Style {
        // MARK: 样式枚举

        /// alent 弹窗
        case alert(_ congig: AlertConfig = .defaultConfig())
        /// sheet 选择列
        case sheet(_ congig: SheetConfig = .defaultConfig())
        /// menu 菜单
        case menu(_ congig: MenuConfig = .defaultConfig())
        /// bubble 气泡
        case bubble(_ congig: BubbleConfig = .defaultConfig())
        /// notice 通知
        case notice(_ congig: NoticeConfig = .defaultConfig())
        /// drop 坠下
        case drop(_ congig: NoticeConfig = .defaultConfig())
        /// rise 升起
        case rise(_ congig: NoticeConfig = .defaultConfig())

        // MARK: 样式配置对象

        public class AlertConfig: BaseConfig {
            /// 动画前的初始大小size
            var startSize: CGSize = .init(width: 10, height: 10)
        }

        public class SheetConfig: BaseConfig {}

        public class MenuConfig: BaseConfig {}
        public class BubbleConfig: BaseConfig {}
        public class NoticeConfig: BaseConfig {}
        public class DropConfig: BaseConfig {}
        public class RiseConfig: BaseConfig {}

        public class BaseConfig: NSObject {
            // Lifecycle

            override public required init() {
                super.init()
            }

            public init(startHeight: CGFloat) {
                super.init()
                self.startHeight = startHeight
            }

            // Public

            /// 动画前的初始大小height
            public var startHeight: CGFloat = Wmc_screenWidth / 2
            
            /// 高度是否自动撑开
            public var isAutoHeight: Bool = false

            /// 默认配置
            public static func defaultConfig() -> Self {
                return .init()
            }
        }
    }
}

public typealias WmcPresentStyleAlertConfig = WmcPresentVC.Style.AlertConfig
public typealias WmcPresentStyleSheetConfig = WmcPresentVC.Style.SheetConfig
public typealias WmcPresentStyleMenuConfig = WmcPresentVC.Style.MenuConfig
public typealias WmcPresentStyleBubbleConfig = WmcPresentVC.Style.BubbleConfig
public typealias WmcPresentStyleNoticeConfig = WmcPresentVC.Style.NoticeConfig
public typealias WmcPresentStyleDropConfig = WmcPresentVC.Style.DropConfig
public typealias WmcPresentStyleRiseConfig = WmcPresentVC.Style.RiseConfig

public extension WmcPresentStyleMenuConfig {}
